﻿<phone:PhoneApplicationPage 
    x:Class="Islamic_influence_in_Venetian_cuture.View.LearnWord"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:this="clr-namespace:Islamic_influence_in_Venetian_cuture.View"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <UserControl.Resources>
        <this:LearnWordConverter x:Key="LearnWordConverter"/>
    </UserControl.Resources>

    <!--LayoutRoot è la griglia radice in cui viene inserito tutto il contenuto della pagina-->
    <Grid x:Name="LayoutRoot">

        <Grid.Background>
            <ImageBrush ImageSource="/Resources/pivot/5.png"/>
        </Grid.Background>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contiene il nome dell'applicazione e il titolo della pagina-->
        <StackPanel x:Name="TitlePanel" Margin="0,17,0,28" Background="#90202020">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding Title}" Height="27" Style="{StaticResource PhoneTextNormalStyle}" TextAlignment="{Binding Culture, Converter={StaticResource TextAlignmentConverter}}" />
            <TextBlock x:Name="PageTitle" Text="{Binding LearnWord}" Height="96" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" TextAlignment="{Binding Culture, Converter={StaticResource TextAlignmentConverter}}" />
        </StackPanel>

        <!--ContentPanel - inserire ulteriore contenuto qui-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Background="#90202020">
        	<ListBox Name="WordList" ItemsSource="{Binding}" SelectionMode="Single" SelectionChanged="WordList_SelectionChanged">
        		<ListBox.ItemTemplate>
        			<DataTemplate>
                        <Border BorderThickness="6,3" Height="126" Background="{Binding Path=IsSelected, Converter={StaticResource LearnWordConverter}}" BorderBrush="#FF1BA1E2" VerticalAlignment="Top"><!--Background="#FFF6F6F6"-->
                            <Grid Height="120" Width="444">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="324"/>
                                    <ColumnDefinition Width="120"/>
                                </Grid.ColumnDefinitions>
                                <Grid Grid.Column="0" Height="120" VerticalAlignment="Top" d:LayoutOverrides="HorizontalAlignment">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="30"/>
                                        <RowDefinition Height="30"/>
                                        <RowDefinition Height="60"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="{Binding English}" Height="30" Foreground="Black" />
                                    <TextBlock Grid.Row="1" Text="{Binding Italian}" Height="30" Foreground="Black" />
                                    <Grid Height="60" Grid.Row="2">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="162"/>
                                            <ColumnDefinition Width="162"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="30"/>
                                            <RowDefinition Height="30"/>
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding ArabicTranslit}" Height="30" Foreground="Black" TextAlignment="Left"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Arabic}" Width="152" Height="30" Foreground="Black" TextAlignment="Right"/>
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding FarsiTranslit}" Height="30" Foreground="Black" TextAlignment="Left"/>
                                        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Farsi}" Width="152" Height="30" Foreground="Black" TextAlignment="Right"/>
                                    </Grid>

                                </Grid>
                                <Image Grid.Column="1" Height="120" Width="120" Stretch="Fill" Source="{Binding ImgSource}"/>
                                <!--<Button Grid.Column="1" Height="120" Width="120" Content="{Binding ImgSource}"/>-->
                            </Grid>
                        </Border>
                    </DataTemplate>    		
				</ListBox.ItemTemplate>
        	</ListBox>
        </Grid>
    </Grid>
 
    <!--Codice di esempio che illustra l'utilizzo di ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Pulsante 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Pulsante 2"/>-->
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="Arabic_bar" Text="Arabic" Click="Arabic_bar_Click" />
                <shell:ApplicationBarMenuItem x:Name="English_bar" Text="English" Click="English_bar_Click" />
                <shell:ApplicationBarMenuItem x:Name="Farsi_bar" Text="Farsi" Click="Farsi_bar_Click" />
                <shell:ApplicationBarMenuItem x:Name="Italian_bar" Text="Italiano" Click="Italian_bar_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
